Integrand size = 36, antiderivative size = 316 \[ \int \frac {A+B \tan (c+d x)}{\sqrt {\cot (c+d x)} (a+i a \tan (c+d x))^3} \, dx=-\frac {\left (\frac {1}{16}+\frac {i}{16}\right ) ((1+i) A+B) \arctan \left (1-\sqrt {2} \sqrt {\cot (c+d x)}\right )}{\sqrt {2} a^3 d}+\frac {\left (\frac {1}{16}+\frac {i}{16}\right ) ((1+i) A+B) \arctan \left (1+\sqrt {2} \sqrt {\cot (c+d x)}\right )}{\sqrt {2} a^3 d}+\frac {(A+i B) \cot ^{\frac {3}{2}}(c+d x)}{6 d (i a+a \cot (c+d x))^3}+\frac {A \sqrt {\cot (c+d x)}}{4 a d (i a+a \cot (c+d x))^2}+\frac {(2 i A+B) \sqrt {\cot (c+d x)}}{8 d \left (i a^3+a^3 \cot (c+d x)\right )}+\frac {(2 i A+(1-i) B) \log \left (1-\sqrt {2} \sqrt {\cot (c+d x)}+\cot (c+d x)\right )}{32 \sqrt {2} a^3 d}-\frac {(2 i A+(1-i) B) \log \left (1+\sqrt {2} \sqrt {\cot (c+d x)}+\cot (c+d x)\right )}{32 \sqrt {2} a^3 d} \]
[Out]
Time = 0.98 (sec) , antiderivative size = 316, normalized size of antiderivative = 1.00, number of steps used = 14, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.278, Rules used = {3662, 3676, 3677, 3615, 1182, 1176, 631, 210, 1179, 642} \[ \int \frac {A+B \tan (c+d x)}{\sqrt {\cot (c+d x)} (a+i a \tan (c+d x))^3} \, dx=-\frac {\left (\frac {1}{16}+\frac {i}{16}\right ) (B+(1+i) A) \arctan \left (1-\sqrt {2} \sqrt {\cot (c+d x)}\right )}{\sqrt {2} a^3 d}+\frac {\left (\frac {1}{16}+\frac {i}{16}\right ) (B+(1+i) A) \arctan \left (\sqrt {2} \sqrt {\cot (c+d x)}+1\right )}{\sqrt {2} a^3 d}+\frac {(B+2 i A) \sqrt {\cot (c+d x)}}{8 d \left (a^3 \cot (c+d x)+i a^3\right )}+\frac {(2 i A+(1-i) B) \log \left (\cot (c+d x)-\sqrt {2} \sqrt {\cot (c+d x)}+1\right )}{32 \sqrt {2} a^3 d}-\frac {(2 i A+(1-i) B) \log \left (\cot (c+d x)+\sqrt {2} \sqrt {\cot (c+d x)}+1\right )}{32 \sqrt {2} a^3 d}+\frac {(A+i B) \cot ^{\frac {3}{2}}(c+d x)}{6 d (a \cot (c+d x)+i a)^3}+\frac {A \sqrt {\cot (c+d x)}}{4 a d (a \cot (c+d x)+i a)^2} \]
[In]
[Out]
Rule 210
Rule 631
Rule 642
Rule 1176
Rule 1179
Rule 1182
Rule 3615
Rule 3662
Rule 3676
Rule 3677
Rubi steps \begin{align*} \text {integral}& = \int \frac {\cot ^{\frac {3}{2}}(c+d x) (B+A \cot (c+d x))}{(i a+a \cot (c+d x))^3} \, dx \\ & = \frac {(A+i B) \cot ^{\frac {3}{2}}(c+d x)}{6 d (i a+a \cot (c+d x))^3}+\frac {\int \frac {\sqrt {\cot (c+d x)} \left (-\frac {3}{2} a (i A-B)+\frac {3}{2} a (3 A-i B) \cot (c+d x)\right )}{(i a+a \cot (c+d x))^2} \, dx}{6 a^2} \\ & = \frac {(A+i B) \cot ^{\frac {3}{2}}(c+d x)}{6 d (i a+a \cot (c+d x))^3}+\frac {A \sqrt {\cot (c+d x)}}{4 a d (i a+a \cot (c+d x))^2}+\frac {\int \frac {-3 i a^2 A+3 a^2 (3 A-2 i B) \cot (c+d x)}{\sqrt {\cot (c+d x)} (i a+a \cot (c+d x))} \, dx}{24 a^4} \\ & = \frac {(A+i B) \cot ^{\frac {3}{2}}(c+d x)}{6 d (i a+a \cot (c+d x))^3}+\frac {A \sqrt {\cot (c+d x)}}{4 a d (i a+a \cot (c+d x))^2}+\frac {(2 i A+B) \sqrt {\cot (c+d x)}}{8 d \left (i a^3+a^3 \cot (c+d x)\right )}+\frac {\int \frac {-3 i a^3 B-3 a^3 (2 i A+B) \cot (c+d x)}{\sqrt {\cot (c+d x)}} \, dx}{48 a^6} \\ & = \frac {(A+i B) \cot ^{\frac {3}{2}}(c+d x)}{6 d (i a+a \cot (c+d x))^3}+\frac {A \sqrt {\cot (c+d x)}}{4 a d (i a+a \cot (c+d x))^2}+\frac {(2 i A+B) \sqrt {\cot (c+d x)}}{8 d \left (i a^3+a^3 \cot (c+d x)\right )}+\frac {\text {Subst}\left (\int \frac {3 i a^3 B+3 a^3 (2 i A+B) x^2}{1+x^4} \, dx,x,\sqrt {\cot (c+d x)}\right )}{24 a^6 d} \\ & = \frac {(A+i B) \cot ^{\frac {3}{2}}(c+d x)}{6 d (i a+a \cot (c+d x))^3}+\frac {A \sqrt {\cot (c+d x)}}{4 a d (i a+a \cot (c+d x))^2}+\frac {(2 i A+B) \sqrt {\cot (c+d x)}}{8 d \left (i a^3+a^3 \cot (c+d x)\right )}+\frac {\left (\left (\frac {1}{16}+\frac {i}{16}\right ) ((1+i) A+B)\right ) \text {Subst}\left (\int \frac {1+x^2}{1+x^4} \, dx,x,\sqrt {\cot (c+d x)}\right )}{a^3 d}-\frac {(2 i A+(1-i) B) \text {Subst}\left (\int \frac {1-x^2}{1+x^4} \, dx,x,\sqrt {\cot (c+d x)}\right )}{16 a^3 d} \\ & = \frac {(A+i B) \cot ^{\frac {3}{2}}(c+d x)}{6 d (i a+a \cot (c+d x))^3}+\frac {A \sqrt {\cot (c+d x)}}{4 a d (i a+a \cot (c+d x))^2}+\frac {(2 i A+B) \sqrt {\cot (c+d x)}}{8 d \left (i a^3+a^3 \cot (c+d x)\right )}+\frac {\left (\left (\frac {1}{32}+\frac {i}{32}\right ) ((1+i) A+B)\right ) \text {Subst}\left (\int \frac {1}{1-\sqrt {2} x+x^2} \, dx,x,\sqrt {\cot (c+d x)}\right )}{a^3 d}+\frac {\left (\left (\frac {1}{32}+\frac {i}{32}\right ) ((1+i) A+B)\right ) \text {Subst}\left (\int \frac {1}{1+\sqrt {2} x+x^2} \, dx,x,\sqrt {\cot (c+d x)}\right )}{a^3 d}+\frac {(2 i A+(1-i) B) \text {Subst}\left (\int \frac {\sqrt {2}+2 x}{-1-\sqrt {2} x-x^2} \, dx,x,\sqrt {\cot (c+d x)}\right )}{32 \sqrt {2} a^3 d}+\frac {(2 i A+(1-i) B) \text {Subst}\left (\int \frac {\sqrt {2}-2 x}{-1+\sqrt {2} x-x^2} \, dx,x,\sqrt {\cot (c+d x)}\right )}{32 \sqrt {2} a^3 d} \\ & = \frac {(A+i B) \cot ^{\frac {3}{2}}(c+d x)}{6 d (i a+a \cot (c+d x))^3}+\frac {A \sqrt {\cot (c+d x)}}{4 a d (i a+a \cot (c+d x))^2}+\frac {(2 i A+B) \sqrt {\cot (c+d x)}}{8 d \left (i a^3+a^3 \cot (c+d x)\right )}+\frac {(2 i A+(1-i) B) \log \left (1-\sqrt {2} \sqrt {\cot (c+d x)}+\cot (c+d x)\right )}{32 \sqrt {2} a^3 d}-\frac {(2 i A+(1-i) B) \log \left (1+\sqrt {2} \sqrt {\cot (c+d x)}+\cot (c+d x)\right )}{32 \sqrt {2} a^3 d}+-\frac {\left (\left (\frac {1}{16}+\frac {i}{16}\right ) ((1+i) A+B)\right ) \text {Subst}\left (\int \frac {1}{-1-x^2} \, dx,x,1+\sqrt {2} \sqrt {\cot (c+d x)}\right )}{\sqrt {2} a^3 d}+\frac {\left (\left (\frac {1}{16}+\frac {i}{16}\right ) ((1+i) A+B)\right ) \text {Subst}\left (\int \frac {1}{-1-x^2} \, dx,x,1-\sqrt {2} \sqrt {\cot (c+d x)}\right )}{\sqrt {2} a^3 d} \\ & = -\frac {\left (\frac {1}{16}+\frac {i}{16}\right ) ((1+i) A+B) \arctan \left (1-\sqrt {2} \sqrt {\cot (c+d x)}\right )}{\sqrt {2} a^3 d}+\frac {\left (\frac {1}{16}+\frac {i}{16}\right ) ((1+i) A+B) \arctan \left (1+\sqrt {2} \sqrt {\cot (c+d x)}\right )}{\sqrt {2} a^3 d}+\frac {(A+i B) \cot ^{\frac {3}{2}}(c+d x)}{6 d (i a+a \cot (c+d x))^3}+\frac {A \sqrt {\cot (c+d x)}}{4 a d (i a+a \cot (c+d x))^2}+\frac {(2 i A+B) \sqrt {\cot (c+d x)}}{8 d \left (i a^3+a^3 \cot (c+d x)\right )}+\frac {(2 i A+(1-i) B) \log \left (1-\sqrt {2} \sqrt {\cot (c+d x)}+\cot (c+d x)\right )}{32 \sqrt {2} a^3 d}-\frac {(2 i A+(1-i) B) \log \left (1+\sqrt {2} \sqrt {\cot (c+d x)}+\cot (c+d x)\right )}{32 \sqrt {2} a^3 d} \\ \end{align*}
Time = 5.79 (sec) , antiderivative size = 196, normalized size of antiderivative = 0.62 \[ \int \frac {A+B \tan (c+d x)}{\sqrt {\cot (c+d x)} (a+i a \tan (c+d x))^3} \, dx=-\frac {\sqrt {\cot (c+d x)} \sqrt {\tan (c+d x)} \left (3 \sqrt [4]{-1} (A-i B) \arctan \left ((-1)^{3/4} \sqrt {\tan (c+d x)}\right ) \sec ^3(c+d x) (\cos (3 (c+d x))+i \sin (3 (c+d x)))+3 \sqrt [4]{-1} A \text {arctanh}\left ((-1)^{3/4} \sqrt {\tan (c+d x)}\right ) \sec ^3(c+d x) (\cos (3 (c+d x))+i \sin (3 (c+d x)))+\sqrt {\tan (c+d x)} (-3 i+\tan (c+d x)) (2 i A+B+3 i B \tan (c+d x))\right )}{24 a^3 d (-i+\tan (c+d x))^3} \]
[In]
[Out]
Time = 0.55 (sec) , antiderivative size = 155, normalized size of antiderivative = 0.49
method | result | size |
derivativedivides | \(\frac {\frac {4 \left (\frac {i A}{16}+\frac {B}{16}\right ) \arctan \left (\frac {2 \sqrt {\cot \left (d x +c \right )}}{\sqrt {2}-i \sqrt {2}}\right )}{\sqrt {2}-i \sqrt {2}}+\frac {i \left (\frac {-i \left (2 i A +B \right ) \cot \left (d x +c \right )^{\frac {5}{2}}+\left (\frac {2 i A}{3}+\frac {10 B}{3}\right ) \cot \left (d x +c \right )^{\frac {3}{2}}+i B \sqrt {\cot \left (d x +c \right )}}{\left (i+\cot \left (d x +c \right )\right )^{3}}+\frac {2 A \arctan \left (\frac {2 \sqrt {\cot \left (d x +c \right )}}{\sqrt {2}+i \sqrt {2}}\right )}{\sqrt {2}+i \sqrt {2}}\right )}{8}}{a^{3} d}\) | \(155\) |
default | \(\frac {\frac {4 \left (\frac {i A}{16}+\frac {B}{16}\right ) \arctan \left (\frac {2 \sqrt {\cot \left (d x +c \right )}}{\sqrt {2}-i \sqrt {2}}\right )}{\sqrt {2}-i \sqrt {2}}+\frac {i \left (\frac {-i \left (2 i A +B \right ) \cot \left (d x +c \right )^{\frac {5}{2}}+\left (\frac {2 i A}{3}+\frac {10 B}{3}\right ) \cot \left (d x +c \right )^{\frac {3}{2}}+i B \sqrt {\cot \left (d x +c \right )}}{\left (i+\cot \left (d x +c \right )\right )^{3}}+\frac {2 A \arctan \left (\frac {2 \sqrt {\cot \left (d x +c \right )}}{\sqrt {2}+i \sqrt {2}}\right )}{\sqrt {2}+i \sqrt {2}}\right )}{8}}{a^{3} d}\) | \(155\) |
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 635 vs. \(2 (247) = 494\).
Time = 0.28 (sec) , antiderivative size = 635, normalized size of antiderivative = 2.01 \[ \int \frac {A+B \tan (c+d x)}{\sqrt {\cot (c+d x)} (a+i a \tan (c+d x))^3} \, dx=\frac {{\left (3 \, a^{3} d \sqrt {\frac {i \, A^{2} + 2 \, A B - i \, B^{2}}{a^{6} d^{2}}} e^{\left (6 i \, d x + 6 i \, c\right )} \log \left (-\frac {2 \, {\left ({\left (i \, a^{3} d e^{\left (2 i \, d x + 2 i \, c\right )} - i \, a^{3} d\right )} \sqrt {\frac {i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} - 1}} \sqrt {\frac {i \, A^{2} + 2 \, A B - i \, B^{2}}{a^{6} d^{2}}} + {\left (A - i \, B\right )} e^{\left (2 i \, d x + 2 i \, c\right )}\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{i \, A + B}\right ) - 3 \, a^{3} d \sqrt {\frac {i \, A^{2} + 2 \, A B - i \, B^{2}}{a^{6} d^{2}}} e^{\left (6 i \, d x + 6 i \, c\right )} \log \left (-\frac {2 \, {\left ({\left (-i \, a^{3} d e^{\left (2 i \, d x + 2 i \, c\right )} + i \, a^{3} d\right )} \sqrt {\frac {i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} - 1}} \sqrt {\frac {i \, A^{2} + 2 \, A B - i \, B^{2}}{a^{6} d^{2}}} + {\left (A - i \, B\right )} e^{\left (2 i \, d x + 2 i \, c\right )}\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{i \, A + B}\right ) + 24 \, a^{3} d \sqrt {-\frac {i \, A^{2}}{64 \, a^{6} d^{2}}} e^{\left (6 i \, d x + 6 i \, c\right )} \log \left (\frac {{\left (8 \, {\left (a^{3} d e^{\left (2 i \, d x + 2 i \, c\right )} - a^{3} d\right )} \sqrt {\frac {i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} - 1}} \sqrt {-\frac {i \, A^{2}}{64 \, a^{6} d^{2}}} + i \, A\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{8 \, a^{3} d}\right ) - 24 \, a^{3} d \sqrt {-\frac {i \, A^{2}}{64 \, a^{6} d^{2}}} e^{\left (6 i \, d x + 6 i \, c\right )} \log \left (-\frac {{\left (8 \, {\left (a^{3} d e^{\left (2 i \, d x + 2 i \, c\right )} - a^{3} d\right )} \sqrt {\frac {i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} - 1}} \sqrt {-\frac {i \, A^{2}}{64 \, a^{6} d^{2}}} - i \, A\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{8 \, a^{3} d}\right ) + 2 \, {\left (2 \, {\left (A - 2 i \, B\right )} e^{\left (6 i \, d x + 6 i \, c\right )} + {\left (A + 4 i \, B\right )} e^{\left (4 i \, d x + 4 i \, c\right )} - {\left (2 \, A - i \, B\right )} e^{\left (2 i \, d x + 2 i \, c\right )} - A - i \, B\right )} \sqrt {\frac {i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} - 1}}\right )} e^{\left (-6 i \, d x - 6 i \, c\right )}}{96 \, a^{3} d} \]
[In]
[Out]
\[ \int \frac {A+B \tan (c+d x)}{\sqrt {\cot (c+d x)} (a+i a \tan (c+d x))^3} \, dx=\frac {i \left (\int \frac {A}{\tan ^{3}{\left (c + d x \right )} \sqrt {\cot {\left (c + d x \right )}} - 3 i \tan ^{2}{\left (c + d x \right )} \sqrt {\cot {\left (c + d x \right )}} - 3 \tan {\left (c + d x \right )} \sqrt {\cot {\left (c + d x \right )}} + i \sqrt {\cot {\left (c + d x \right )}}}\, dx + \int \frac {B \tan {\left (c + d x \right )}}{\tan ^{3}{\left (c + d x \right )} \sqrt {\cot {\left (c + d x \right )}} - 3 i \tan ^{2}{\left (c + d x \right )} \sqrt {\cot {\left (c + d x \right )}} - 3 \tan {\left (c + d x \right )} \sqrt {\cot {\left (c + d x \right )}} + i \sqrt {\cot {\left (c + d x \right )}}}\, dx\right )}{a^{3}} \]
[In]
[Out]
Exception generated. \[ \int \frac {A+B \tan (c+d x)}{\sqrt {\cot (c+d x)} (a+i a \tan (c+d x))^3} \, dx=\text {Exception raised: RuntimeError} \]
[In]
[Out]
\[ \int \frac {A+B \tan (c+d x)}{\sqrt {\cot (c+d x)} (a+i a \tan (c+d x))^3} \, dx=\int { \frac {B \tan \left (d x + c\right ) + A}{{\left (i \, a \tan \left (d x + c\right ) + a\right )}^{3} \sqrt {\cot \left (d x + c\right )}} \,d x } \]
[In]
[Out]
Timed out. \[ \int \frac {A+B \tan (c+d x)}{\sqrt {\cot (c+d x)} (a+i a \tan (c+d x))^3} \, dx=\int \frac {A+B\,\mathrm {tan}\left (c+d\,x\right )}{\sqrt {\mathrm {cot}\left (c+d\,x\right )}\,{\left (a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}\right )}^3} \,d x \]
[In]
[Out]